<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登录</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="./login.css">
	<script src="./jquery-2.1.0.js"></script>   
  </head>
  
  <body>
   <form action="LoginServlet" id="form">
   <p>欢迎登录</p>
     <table>
			    <tr>
			    <th> 帐号：  </th>
			    <th> <input type="text" name="name" id="name">  </th>
			    </tr>
			    
			     <tr>
			    <th> 密码：  </th>
			    <th>  <input type="password" name="pwd" id="pwd"> </th>
			    </tr>
			    
			    <tr >
			    <th >  </th> <th > <input type="button" id="sub" value="登录"> </th>
			    </tr>
    </table>
 </form>
<script type="text/javascript">

$("#sub").click(function () {
	if($("#name").val()==""){
		alert("用户名不能为空！");
	}else if($("#pwd").val()==""){
		alert("密码不能为空！");
	}else{
		
		$("#form").submit();
	}
});
</script>
  </body>
</html>
